<script language="javascript">
function showPaperWindow(id)
{
    window.open("/sale/show_print_sale_paper/"+id,"_blank","height=700,width=700,top=300,left=400,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no");
}
function showAgentWindow(id)
{
    window.open("/other_org/agent_info/"+id,"_blank","height=500,width=500,top=300,left=400,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no");
}
</script>
<h1>消息管理 - <span id="secondHeading">察看个人消息</span></h1>
<% if @flash[:notice] -%>
<div id="notice"><%= @flash[:notice] %></div>
<% end -%>
<TABLE border="0" id="LIST_TB">
	<TR id="LIST_TB_TITLE">
      <td nowrap>消息</td>
      <td nowrap>时间</td>
      <td nowrap>类型</td>
      <td></td>
    </tr>
    <%@messages.each do |message|%>
    <TR id="LIST_TB_CONTENT1">
      <td><%=message.message%>:<a href="javascript:showPaperWindow(<%=message.relativelyId%>)"><%=message.relativelyId%></a></td>
      <td><%=message.create_date_at%></td>
      <td><%='销售' if message.messageType.eql? 'SA'%></td>
      <td><a href="/welcome/check_message/<%=message.id%>" onclick="return confirm('您确认该消息吗?');"><img src="/images/yes.gif" alt="确认消息"></a></td>
    </tr>
    <%end%>
</table>